package com.scalar.chiptrack.jasper.base.customizer;

import net.sf.jasperreports.engine.JRChart;
import net.sf.jasperreports.engine.JRAbstractChartCustomizer;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.renderer.category.BarRenderer;

/**
 * User: sujan
 * Date: Apr 30, 2011
 * Time: 2:17:22 PM
 */
public class BarChartCustomizer extends JRAbstractChartCustomizer {

	public void customize(JFreeChart chart, JRChart jasperChart) {
		if(jasperChart.getChartType() == JRChart.CHART_TYPE_BAR) {
		BarRenderer renderer = (BarRenderer) chart.getCategoryPlot().getRenderer();
 
		//Set maximum bar width
		renderer.setMaximumBarWidth(0.10);
		renderer.setItemMargin(0.01);

		}

	}
}
